package com.cbd.util;
/**
 * @Author: CBD
 * @Date: 2024/11/5 15:50
 * @Description:状态枚举类
 */

public enum StatusEnum {
    SUCCESS(200, "请求处理成功"),
    ERROR(400, "请求处理失败"),
    UNAUTHORIZED(401, "未授权的访问"),
    FORBIDDEN(403, "禁止访问"),
    NOT_FOUND(404, "资源不存在"),
    INTERNAL_SERVER_ERROR(500, "服务器内部错误"),
    INVALID_PARAMETER(1000, "参数无效"),
    //...更多状态码
    ;
    public final Integer code;
    public final String message;

    StatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
